<script type="text/javascript">
$(function(){
    $( ".button").click( function () {
         
		idList = "";
		sp = "";
		$( ".checkbox-sel" ).each(function(){
			if ($(this).attr("checked") == "checked") {
				idList += sp + $(this).val();
				if (sp == "") sp = ",";
			}
		});
               
		if (idList != "") {
			switch (this.id) {
				case 'accep-button':
					alertText = '【支付】';
					reqUrl = '/admini/managepay/chargeaccep';
					break;						
			}
			if (confirm( "你真的要" +alertText+ "选中的数据吗？" )) {
				$.ajax({
					type: "POST",
					url: reqUrl,
					dataType: "json",
					data:"idList="+idList,
					success: function(data) {
						var result=eval(data);
						if (result == true) {
							//$( "#queryButton").click();
							alert( alertText + "成功！" );
						} else {
							alert( alertText + "失败！" );
							
						}
					}
				});
			}
		} else {
			alert("请选择要操作的数据!");
		}
	});
    });
</script>
<form action="/admini/managepay/charge" method="get" style="margin:0px">
<div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;">
<label for="member">用户名：</label><input type="text" id="username" name="username" value="<?php echo $this->username;?>" />
<input type="submit" id="queryButton" value="查询"/>
</div>
</form>


<div class="dataTable">
    <table>                                               
        <tr>
            <th class="w1" width="5px"></th>
            <th class="w2" width="10%">ID</th>
            <th class="w3" width="10%">状态</th>
            <th class="w4" width="10%">用户名</th>
            <th class="w5" width="10%">创建时间</th>
            <th class="w6" width="10%">金额</th>
            <th class="w7" width="10%">服务费</th>
            <th class="w8" width="10%">实名</th>
            <th class="w9" width="15%">支付宝账号</th>
            <th class="w10" width="15%">支付时间</th>
        </tr>  

        <?php
        if ($this->topUpAlipayList) {
            foreach ($this->topUpAlipayList as $Item) {
                ?>
                <tr>
                    <td class="w1" nowrap>
                        <?php
                        if($Item->status == 1)
                        {
                        ?>
                            <input type="checkbox" value="<?php echo $Item->id;?>" class="checkbox-sel">
                        <?php
                        }
                        ?>
                    </td>
                    <td class="w2" nowrap><a href="/admini/managepay/chargedetail/id/<?php echo $Item->id;?>" class="indexa"><?php echo $Item->id; ?></a></td>
                    <td class="w3" nowrap><?php echo $Item->statuscaption;?></td>
                    <td class="w4" nowrap><?php if($Item->userinfo) echo $Item->userinfo->nikename; else echo '';?></td>
                    <td class="w5" nowrap><?php echo $Item->dateCreated;?></td>
                    <td class="w6" nowrap><?php echo number_format($Item->amount,2);?></td>
                    <td class="w7" nowrap><?php echo number_format($Item->serviceFee,2);?></td>
                    <td class="w8" nowrap><?php echo $Item->realname;?></td>
                    <td class="w9" nowrap><?php echo $Item->useraccount;?></td>
                    <td class="w10" nowrap><?php echo $Item->dateProcee;?></td>
                </tr>
                <?php
            }
        }
        ?>
    </table>
</div>     
<div>
<input class="button" id="accep-button" type="button" value="支付处理" />
</div>
<div class="toolbar" <?php if (empty($this->topUpAlipayList)) echo "style='display: none'"; ?>>
<?php echo $this->partial('paging.phtml', array("pages" => $this->topUpAlipay)); ?>
</div>